package com.zzty.zzlp.dao;


import com.zzty.zzlp.entity.Question;
import com.zzty.zzlp.entity.SelfExam;
import com.zzty.zzlp.entity.TeamExam;
import com.zzty.zzlp.entity.User_info;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface User_infoMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User_info record);

    int insertSelective(User_info record);

    @Select("select * from user_info where user_id=#{user_id}")
    User_info selectByPrimaryKey(Integer user_id);

    @Update("update user_info set name=#{name} ,charactern=#{charactern} ,sex=#{sex} ,age=#{age},mail=#{mail}, phone=#{phone}, nativeplace=#{nativeplace}, city=#{city},  educationexp=#{educationexp},  profession=#{profession},englishlevel=#{englishlevel},  functions=#{functions},  selfassessment=#{selfassessment} where  user_id  =#{user_id}")
    int updateByPrimaryKeySelective1(User_info record);

    @Update("update user_info set photo=#{photo} where  user_id  =#{user_id}")
    int upImg(@Param("photo")String photo,@Param("user_id")int user_id );

    int updateByPrimaryKey(User_info record);

    @Select("select * from selfexam where clazzId=#{clazzId} order by id desc limit #{Num1},#{Num2}")
    List<SelfExam> sel(@Param("clazzId")int clazzId, @Param("Num1")int Num1, @Param("Num2")int Num2);

    @Select("select * from teamexam where clazzId=#{clazzId} order by id desc limit #{Num1},#{Num2}")
    List<TeamExam> te(@Param("clazzId")int clazzId, @Param("Num1")int Num1, @Param("Num2")int Num2);

    @Select("select * from question where id=#{id}")
    Question getqu(@Param("id")int id );


}
